package com.windy.common.transmit.kafka;

import com.windy.common.header.Headers;
import com.windy.common.header.KafkaHeader;
import com.windy.common.transmit.TransmitHeader;

import java.util.function.Supplier;

/**
 * Created by liyufeng on 2022/5/9
 */
public class KafkaConsumerTransitHeader extends TransmitHeader<org.apache.kafka.common.header.Headers> {

    @Override
    protected void replayHeader(Headers headers, Supplier<org.apache.kafka.common.header.Headers> supplier) {
        supplier.get().iterator().forEachRemaining(header -> {
            headers.add(new KafkaHeader(header));
        });
    }

    @Override
    protected Headers pickerHeader(Supplier<org.apache.kafka.common.header.Headers> supplier) {
        return null;
    }
}
